//booking class implementation
#include "booking.h"

//default constructor
booking::booking() :
bookingNumber(-1),
passenger_(NULL),
flight_(NULL),
seatNumber(""),
isCancelled(true)
{};

//constructor
booking::booking(int b, passenger* p, flight* f, string seat, bool cancel) :
bookingNumber(b),
passenger_(p),
flight_(f),
seatNumber(seat),
isCancelled(cancel)
{};

//destructor
booking::~booking(){};

passenger* booking::getPassenger() const
{
	return passenger_;
};

void booking::setPassenger(passenger* p)
{
	passenger_ = p;
};

flight* booking::getFlight() const
{
	return flight_;
};

void booking::setFlight(flight* f)
{
	flight_ = f;
};

string booking::getSeatNumber() const
{
	return seatNumber;
};

void booking::setSeatNumber(string seat)
{
	seatNumber = seat;
};

int booking::getBookingNumber() const
{
	return bookingNumber;
};

void booking::cancel()
{
	isCancelled = true;
	flight_->freeSeat(seatNumber);
};

bool booking::is_Cancelled() const
{
	return isCancelled;
};
